<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h1>Ejemplo de Tree</h1>
            <h:form>
                <h:panelGrid columns="1" width="100%" >

                    <rich:tree style="width:300px"
                               nodeSelectListener="#{simpleTreeBean.processSelection}"
                               reRender="selectedNode" 
                               ajaxSubmitSelection="true"
                               switchType="ajax"
                               value="#{simpleTreeBean.treeNode}"
                               var="item" >
                    </rich:tree>

                    <h:outputText escape="false" value="Selected Node: #{simpleTreeBean.nodeTitle}" id="selectedNode" />

                </h:panelGrid>

            </h:form>
        </body>
    </html>
</f:view>